<template>
  <div class="meeting-box">
    <div class="meeting-info">
      <img class="img" src="@/assets/img/roomList/defaultUserHead.png" alt="" />
      <div class="meeting-other">
        <div class="centent">
          <div class="name">{{ info.title }}</div>
          <div class="time">{{ info.date }}</div>
          <div class="nums">
            <div class="other-info">
              <img src="@/assets/img/roomList/icon-personnel.png" alt="" />
              <span>{{ info.num }}</span>
            </div>
            <div class="end-info" v-if="type == 'end'">
              <div>{{ info.status }}</div>
              <div class="line"></div>
              <div>参会{{ info.duration }}分钟</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div v-if="type == 'end'">
      <div class="playback">观看回放</div>
    </div>
    <div v-else @click="goRoom">
      <div class="button" v-if="info.status == ROOM_STATUS.conduct">
        <img
          class="img"
          src="@/assets/img/roomList/icon-voice-login.gif"
          alt=""
        />
        <span>立即加入</span>
      </div>
      <div class="timer" v-if="info.status == ROOM_STATUS.not_started">
        倒计时：<span>00</span>时 <span>05</span>分 <span>05</span>秒 >
      </div>
    </div>
  </div>
</template>

<script>
import { ROOM_STATUS, USER_TYPE } from "../../../util/constants";
export default {
  props: {
    info: {
      type: Object,
      default: {},
    },
    type: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      ROOM_STATUS
    };
  },
  mounted() {},
  methods: {
    goRoom() {
      this.$emit("goRoom", this.info);
    },
  },
};
</script>

<style scoped lang="scss">
.meeting-box {
  margin-bottom: 13px;
  //   width: 259px;
  background: #ffffff;
  box-shadow: 0px 0px 8px 0px rgba(220, 220, 220, 0.5);
  overflow: hidden;
  border-radius: 6px;
  .meeting-info {
    padding: 13px;
    width: 100%;
    display: flex;
    box-sizing: border-box;
    .img {
      width: 68px;
      height: 68px;
      border-radius: 3px;
      margin-right: 9px;
    }
    .meeting-other {
      display: flex;
      align-items: center;
      flex: 2;
      .centent {
        width: 100%;
      }
      .name {
        font-size: 12px;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.85);
        line-height: 17px;
        text-shadow: 0px 0px 8px rgba(220, 220, 220, 0.5);
      }
      .time {
        margin-top: 9px;
        font-size: 10px;
        font-weight: 400;
        color: #8c8c8c;
        line-height: 14px;
        text-shadow: 0px 0px 8px rgba(220, 220, 220, 0.5);
      }
      .nums {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        img {
          width: 12px;
          height: 10px;
          margin-right: 2px;
          display: inline-block;
        }
        span {
          display: inline-block;
          font-size: 10px;
          font-weight: 400;
          color: #8c8c8c;
          line-height: 13px;
        }
        .end-info {
          font-size: 10px;
          font-weight: 500;
          color: #475aa7;
          line-height: 13px;
          text-shadow: 0px 0px 8px rgba(220, 220, 220, 0.5);
          display: flex;
          align-items: center;
          .line {
            height: 8px;
            margin: 0 5px 0px 5px;
            width: 1px;
            background: #475aa7;
          }
        }
      }
    }
  }
  .button {
    cursor: pointer;
    width: 100%;
    border: none;
    height: 36.76px;
    background: #475aa7;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    .img {
      width: 12px;
      height: 12px;
      margin-right: 4px;
    }
    span {
      font-size: 12px;
      font-weight: 500;
      color: #ffffff;
      line-height: 17px;
      text-shadow: 0px 0px 8px rgba(220, 220, 220, 0.5);
    }
  }
  .timer {
    width: 100%;
    border-top: solid 0.5px #dcdcdc;
    height: 36.76px;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    font-weight: 500;
    color: #8c8c8c;
    line-height: 14px;
    text-shadow: 0px 0px 8px rgba(220, 220, 220, 0.5);
    span {
      color: #475aa7;
      margin-left: 3px;
    }
  }
  .playback {
    cursor: pointer;
    width: 100%;
    border-top: solid 0.5px #dcdcdc;
    height: 36.76px;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: #475aa7;
    line-height: 14px;
    text-shadow: 0px 0px 8px rgba(220, 220, 220, 0.5);
  }
}
</style>
